//
//  HRVoiceSliderView.m
//  Hear
//
//  Created by mac on 2017/4/7.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "HRVoiceSliderView.h"

@interface HRVoiceSliderView ()

@end
@implementation HRVoiceSliderView





-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {

//        [self addSubview:(self.endLabel = endLabel)];
        
        UIButton *lastButton = [UIButton buttonWithType:0];
        [lastButton setImage:[UIImage imageNamed:@"上一个"] forState:0];
        [self addSubview:lastButton];
        [lastButton addTarget:self action:@selector(cutSoundClick:) forControlEvents:UIControlEventTouchUpInside];
        lastButton.tag = 0;
        
        UIButton *nextButton = [UIButton buttonWithType:0];
        [nextButton setImage:[UIImage imageNamed:@"下一个"] forState:0];
        [self addSubview:nextButton];
        nextButton.tag = 1;
        [nextButton addTarget:self action:@selector(cutSoundClick:) forControlEvents:UIControlEventTouchUpInside];

        
        WeakSelf
        [lastButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.bottom.equalTo(weakSelf);
            make.width.equalTo(weakSelf.mas_height);
        }];
        
        [nextButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.right.bottom.equalTo(weakSelf);
            make.width.equalTo(weakSelf.mas_height);
        }];
        
        
        
        
        MyPlayProgressView *progressView = [[MyPlayProgressView alloc] initWithFrame:CGRectMake(30, 0, kFullWidth-140, 20)];
        [self addSubview:(self.progressView = progressView)];
        progressView.minimumValue = 0;


        
    }
    return self;
}

- (void)cutSoundClick:(UIButton *)button{
    if (self.cutSoundBlock){
        self.cutSoundBlock(button.tag);
    }
}





@end
